<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>当当购物车</title>
    <link rel="stylesheet" href="./css/carsList.css">
</head>

<body>
    <div class="container">
        <div class="header">
            <img src="./images/dd_logo.jpg" alt="logo">
            <button type="button" id="toshopListPage">商品列表</button>
        </div>
        <div class="book-list">
            <table>

            </table>
            <button type="button" id="delChecked">删除选中商品</button>
            <h2>商品总价: <span id="totalPrice">￥0</span></h2>
        </div>

    </div>
    <script src="./js/jquery-3.6.0.js"></script>
    <script src="./js/template-web.js"></script>
    <script id="showcarsList" type="text/html">
        <tr>
            <th><input type="checkbox" name="checkAll" {{stateAll ? 'checked' : ''}}></th>
            <th>序号</th>
            <th>商品图片</th>
            <th>商品信息</th>
            <th>单价</th>
            <th>数量</th>
            <th>总价</th>
            <th>操作</th>
        </tr>
        {{each cars}}
        <tr class="allTr">
            <td><input type="checkbox" name="checkItem" {{$value.state ? 'checked' : ''}}></td>
            <td>{{$value.id}}</td>
            <td><img src="{{$value.pic1}}" alt="shop03" width='80' height='80'></td>
            <td width="400px">{{$value.name}}</td>
            <td class="defaultPrice">￥{{$value.unitPrice}}</td>
            <td>
                <input type="button" name="minus" value="-" {{$value.shop <=1? 'disabled' : ''}}>
                <input type="text" name="amount" value="{{$value.shop}}">
                <input type="button" name="plus" value="+">
            </td>
            <td class="total" width=100>￥{{$value.singlePrice}}</td>
            <td><a href="#" class="collect">移入收藏</a><br><a href="#" class="delete">删除</a></td>
        </tr>
        {{/each}}
    </script>
    <script src="js/carsList.js"></script>
</body>

</html>